Repository navigation
Conversation
prepareShutdown() starts dde-session-shutdown.target which declares Conflicts=dde-session-manager.service. systemd stops the current process before PowerOff/Reboot is called, causing the machine to black-screen but not power off. Moving the login1 PowerOff/Reboot call before prepareShutdown() ensures the shutdown/reboot request is received first. DDE-490
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR fixes a shutdown race by initiating the login1 PowerOff/Reboot request before prepareShutdown can start the systemd shutdown target and stop dde-session-manager.service, ensuring the host power action is requested before the session manager may be terminated. Sequence diagram for the fixed shutdown and reboot orderingsequenceDiagram
participant SessionManager
participant login1
participant systemd
participant SessionService as dde-session-manager.service
alt shutdown
SessionManager->>login1: PowerOff(false)
else reboot
SessionManager->>login1: Reboot(false)
end
SessionManager->>SessionManager: prepareShutdown(force)
SessionManager->>systemd: start dde-session-shutdown.target
systemd->>SessionService: stop service
SessionManager->>SessionManager: clearCurrentTty()
login1-->>SessionManager: QDBusPendingReply
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
修复内容
调整
shutdown()和reboot()方法中的执行顺序,将m_login1ManagerInter->PowerOff(false)/Reboot(false)调用移到prepareShutdown(force)之前。根因
prepareShutdown()会启动dde-session-shutdown.target,该 target 声明了Conflicts=dde-session-manager.service。systemd 在解析冲突时会停止dde-session-manager.service(即当前正在执行shutdown()的进程),导致PowerOff(false)/Reboot(false)可能在被调用前进程就被杀掉。竞态路径:
prepareShutdown()→clearCurrentTty()→PowerOff()(同步、快速)当路径 B 先到达时,进程被 SIGTERM 杀死,
PowerOff()永远不会执行,导致屏幕黑屏但主机不断电。修复方案
将
PowerOff(false)/Reboot(false)移到prepareShutdown(force)之前,确保 login1 先收到关机/重启请求,不受 session 拆解竞态影响。关联 Issue
DDE-490
Summary by Sourcery
Bug Fixes: